﻿using System;
using System.Collections.Generic;
using System.Linq;
using SortOf;

namespace Example5
{
    class Program
    {
        static void Main(string[] args)
        {
            Set<int> setX = new Set<int>();
            Set<int> setY = new Set<int>();
            Set<int> setZ = new Set<int>();

            //input data for setX and setY
            Console.WriteLine("added to setX values: ");
            for (int i = 1; i < 5; i++)
            {
                int j = i;
                Console.Write(j + " ");
                setX.add(j);
            }
            Console.Write("\nadded to setY values: \n");
            for (int i = 1; i < 5; i++)
            {
                int j = i + 2;
                Console.Write(j + " ");
                setY.add(j);
            }
            Console.Write("\n\n");

            Console.Write("results \n");

            //functions
            //setZ = setX.union(setY);
            //setZ = setX.intersection(setY);
            setZ = setX.difference(setY);

            setX.printSet();
            setY.printSet();
            setZ.printSet();

            //Console.WriteLine(setX.isSubset(setY));
            //Console.WriteLine(setX.contains(3)); Console.WriteLine(setX.contains(5));

            pressEnter();

        }

        static void pressEnter()
        {
            // Hold till the ENTER key has been pressed.
            ConsoleKeyInfo info = Console.ReadKey();
            while (info.Key != ConsoleKey.Enter)
            {
                info = Console.ReadKey();
            }
        }
    }
}
